package com.cqq.print.business.service.impl;


import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cqq.print.business.dao.PAccountDetailDao;
import com.cqq.print.business.dao.domain.PAccountDetail;
import com.cqq.print.business.service.bean.PAccountDetailBean;


/**
 * @author generated
 * @date 2015-07-01
 */


@Service(value="pAccountDetailService")
public class PAccountDetailServiceImpl implements com.cqq.print.business.service.PAccountDetailService{

             @Autowired
             private PAccountDetailDao pAccountDetailDao;

			
			public List<PAccountDetailBean> findDetailsByAccountId(
					Integer accountId) {
				List<PAccountDetail> listPADetail = pAccountDetailDao.findDetailsByAccountId(accountId);
				if(listPADetail==null||listPADetail.size()<1)
					return null;
				List<PAccountDetailBean> listPADetailBean = new ArrayList<PAccountDetailBean>();
				for (PAccountDetail detail : listPADetail) {
					PAccountDetailBean bean = new PAccountDetailBean();
					BeanUtils.copyProperties(detail, bean);
					listPADetailBean.add(bean);
				}
				return listPADetailBean;
			}

}